home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Draw / Sources / DrawPrxy.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  4.9 KB  |  179 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                DrawPrxy.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef DRAWPRXY_H
  13. #define DRAWPRXY_H
  14.  
  15. #ifndef BASESHP_H
  16. #include "BaseShp.h"
  17. #endif
  18.  
  19. #ifndef BOUNDSHP_H
  20. #include "BoundShp.h"
  21. #endif
  22.  
  23. #ifndef LINESHP_H
  24. #include "LineShp.h"
  25. #endif
  26.  
  27. #ifndef OVALSHP_H
  28. #include "OvalShp.h"
  29. #endif
  30.  
  31. #ifndef RECTSHP_H
  32. #include "RectShp.h"
  33. #endif
  34.  
  35. #ifndef RRECTSHP_H
  36. #include "RRectShp.h"
  37. #endif
  38.  
  39. #ifndef TEXTSHP_H
  40. #include "TextShp.h"
  41. #endif
  42.  
  43. // ----- Part Layer -----
  44.  
  45. #ifndef FWFRMING_H
  46. #include "FWFrming.h"
  47. #endif
  48.  
  49. #ifndef FWPROXY_H
  50. #include "FWProxy.h"
  51. #endif
  52.  
  53. // ----- OpenDoc Includes -----
  54.  
  55. #ifndef SOM_ODShape_xh
  56. #include <Shape.xh>
  57. #endif
  58.  
  59. //========================================================================================
  60. // Forward Declaration
  61. //========================================================================================
  62.  
  63. class ODFrame;
  64. class ODTransform;
  65. class CDrawPart;
  66. class CDrawFrame;
  67.  
  68. //========================================================================================
  69. //    class CProxyShape
  70. //========================================================================================
  71.  
  72. class CProxyShape : public CRectShape, public FW_MProxy
  73. {
  74.  public:
  75.     FW_DECLARE_CLASS
  76.     FW_DECLARE_AUTO(CProxyShape)
  77.     
  78. //----------------------------------------------------------------------------------------
  79. //    Initialization/Destruction
  80. //
  81. public:
  82.     CProxyShape(Environment* ev, const FW_CRect& rect, CDrawPart* drawPart);
  83.     CProxyShape(Environment* ev, CDrawPart* drawPart, FW_CReadableStream& archive);
  84.  
  85. public:
  86.     virtual ~CProxyShape();
  87.     
  88. //----------------------------------------------------------------------------------------
  89. //    Inherited API from FW_MProxy
  90. //
  91. public:
  92.     virtual void                 UsedShapeChanged(Environment* ev, 
  93.                                     FW_CEmbeddingFrame* embeddingFrame, 
  94.                                     ODFrame* odEmbeddedFrame);
  95.     
  96.     virtual ODShape*            FrameShapeRequested(Environment* ev, 
  97.                                     FW_CEmbeddingFrame* embeddingFrame, 
  98.                                     ODFrame* odEmbeddedFrame, 
  99.                                     ODShape* requestedFrameShape);
  100.                                             
  101.     virtual short                CreateFacets(Environment* ev,
  102.                                     FW_CEmbeddingFrame* embeddingFrame,
  103.                                     ODFacet* embeddingFacet,
  104.                                     ODFrame* embeddedFrame,
  105.                                     ODShape* proposedClipShape);
  106.                                             
  107.     virtual FW_Boolean            NeedFacets(Environment *ev, 
  108.                                     FW_CEmbeddingFrame* embeddingFrame) const;
  109.                                     
  110.     virtual FW_Boolean            Reveal(Environment *ev, 
  111.                                        FW_CEmbeddingFrame* embeddingFrame,
  112.                                        ODFrame* embeddedFrame, 
  113.                                        ODShape* revealShape);
  114.                                     
  115. //----------------------------------------------------------------------------------------
  116. //    Inherited API from CRectShape and CBaseShape
  117. //
  118. public:
  119.     virtual void         Removed(Environment* ev);
  120.     virtual void        Deleted(Environment* ev);
  121.     virtual void        RestoreShape(Environment *ev);                
  122.  
  123.     virtual void         RenderShape(Environment* ev, ODFacet* facet, FW_CGraphicContext& gc);
  124.  
  125.     virtual void        SubtractToWorkingClip(Environment *ev, 
  126.                                             CDrawFacetClipper* facetClipper, 
  127.                                             ODFacet* containingFacet, 
  128.                                             ODShape* workingClip,
  129.                                             ODShape* tempShape,
  130.                                             ODShape* limitShape);
  131.     
  132.     virtual void        OffsetShape(Environment *ev, FW_Fixed xDelta, FW_Fixed yDelta);
  133.     virtual void        MapShape(Environment *ev, const FW_CRect& srcRect, const FW_CRect& dstRect);
  134.     
  135.     virtual void         SelectShape(Environment *ev, FW_Boolean state);
  136.  
  137.     virtual void        ChangeRenderVerb(Environment *ev, unsigned short renderVerb);
  138.     
  139.     virtual void        AdjustRectForPenSize(FW_CRect& rect, FW_Fixed penSize) const;
  140.     
  141.     // ----- Frozen -----
  142.     virtual FW_Boolean    SetFrozen(FW_Boolean state);
  143.     virtual FW_Boolean     IsFrozen() const;
  144.  
  145.     // ----- Archiving -----
  146.     virtual void        Flatten(FW_CWritableStream& archive);    
  147.     static void*         Read(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  148.  
  149.     // ----- Linking -----
  150.     virtual void        SetSubscribeLink(Environment* ev, 
  151.                             CDrawSubscribeLink *subscribeLink);
  152.     virtual void        SetPublishLink(Environment* ev, 
  153.                             CDrawPublishLink *subscribeLink);
  154.     virtual FW_Boolean    IsInLinkDestination(Environment* ev);
  155.  
  156.     // ----- Purge -----
  157.     virtual void        MakePurgeable(Environment* ev, CDrawFrame* drawFrame, const FW_CRect& bounds);
  158.                                             
  159. //-----------------------------------------------------------------------------------------
  160. //    New API
  161. //
  162. public:
  163.     void                 MoveBefore(Environment* ev, CProxyShape* before);
  164.     void                 MoveBehind(Environment* ev, CProxyShape* behind);
  165.     
  166.     FW_CRect            GetFrameRect(Environment*) const {return fFrameRect;}
  167.     virtual void ShapeCommitPasteDone(Environment* ev); //Override
  168.  
  169.  
  170. //----------------------------------------------------------------------------------------
  171. //    Data Member
  172. //
  173. private:
  174.     FW_Boolean            fFrozen;
  175.     FW_CRect            fFrameRect;        // cached frame Rect
  176. };
  177.  
  178. #endif
  179.